 import {
   getInviteCode
 } from '../../../utils/networkRequest.js'

 import {
   errorMsg
 } from '../../../utils/tool.js'
 Page({

   /**
    * 页面的初始数据
    */
   data: {
     dataInfo: null, //邀请二维码
   },

   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
     let self = this;
     getInviteCode(options.team_id, (r) => {
       if (r.code == 0) {
         console.log(r)
         self.setData({
           dataInfo: r.data,
         })

       } else {
         errorMsg(r.message);
       }
     })
   },

   /**
    * 用户点击右上角分享
    */
   onShareAppMessage: function(res) {
     debugger;
     if (res.from === 'button') {
       // 来自页面内转发按钮
       console.log(res.target)
     }
     return {
      //  title: '邀请团员',
       path: this.data.dataInfo.jump_url,
       imageUrl: "../../../assets/images/yaoqingtuanyuan.png",
     }
   },
  
 })